<include file="Public/_meta" />
<title>建档</title>
</head>
<body>
<form class="form form-horizontal" action="" id="form-mortgage-alert" method="post">
<table class="table table-border table-bordered table-bg jd" style="width:95%; margin:20px auto;">
  <!--建档-->
  <input name="doc_id" type="hidden" value="{$documentlist.doc_id}" />
  <tr>
      <td width="120">买方信息</td>
      <td>
      <ul>
      <li>姓名：{$documentlist.buy_name}</li>
      <li>身份证号：{$documentlist.buy_card}</li>
      <li>建档时间：{$documentlist.create_time|date="Y-m-d",###}</li>
      <li>单位性质：{$extendlist.nature}</li>
      <li>手机号码：{$extendlist.buy_phone}</li>
      <li>家庭电话：{$extendlist.buy_tel}</li>
      <li>工作单位：{$extendlist.buy_work}</li>
      <li>单位电话：{$extendlist.buy_work_tel}</li>
      </ul>
      </td>
    </tr>
    <tr>
      <td>买方配偶信息</td>
      <td>
      <ul>
      <li>姓名：{$extendlist.buy_spouse_name}</li>
      <li>身份证号：{$documentlist.spouse_card}</li>
      <li>手机号码：{$extendlist.buy_spouse_tel}</li>
      </ul>
      </td>
    </tr>
    <tr>
      <td>卖方信息</td>
      <td>
       <ul>
      <li>姓名：{$documentlist.sell_name}</li>
      <li>手机号码：{$extendlist.sell_phone}</li>
      <li> 家庭电话：{$extendlist.sell_tel}</li>
      </ul>
      </td>
    </tr>
    <tr>
      <td>贷款信息</td>
      <td>
        <ul>
        <li>公积金<input name="account_type" type="radio" value="1" <if condition="$extendlist['account_type'] eq 1">checked</if> class="kk">省行<input name="account_type" type="radio" value="2" <if condition="$extendlist['account_type'] eq 2">checked</if> class="kk">市行<input type="text" name="account_amount" id="account_amount"  value="{$extendlist.account_amount}" class="input-text kk one" style=" width:100px">万元<span class="fonnt01">（如有公积金，请选择公积金类型）</span></li>
        <li>商业<input type="text" name="business_amount" id="business_amount"  value="{$extendlist.business_amount}" class="input-text kk two" style=" width:100px">万元</li>
        <li>贷款总金额<input type="text" name="total_amount" id="total_amount"  value="{$documentlist.amount}" class="input-text kk three" style=" width:100px">万元</li>
        <li>贷款年限<input type="text" name="loan_year" id="loan_year"  value="{$extendlist.loan_year}" class="input-text kk" style=" width:100px">年</li>
        </ul>
      </ul>
      <ul>
      <li>贷款银行：
        <select name="bank_id" class="select2 kk bank-zong">
          <volist name="banks" id="banks" >
            <option <if condition="$documentlist['bank_id'] eq $banks['bank_id']">selected="selected"</if> value="{$banks.bank_id}">{$banks.bank_name}</option>
          </volist>
      </select>
      </li>
      <li>备注<input type="text" name="loan_remark" id="loan_remark"  value="{$extendlist.loan_remark}" class="input-text kk" style=" width:500px"></li>
     </ul>
       <ul>
      <li>监管类型：
      <if condition="$documentlist['supervise'] eq 1">贷款监管</if>
      <if condition="$documentlist['supervise'] eq 2">全款监管</if>
      <if condition="$documentlist['supervise'] eq 3">不监管</if>
      </li>
      </ul>
      </td>
    </tr>
    <tr>
      <td>房屋信息</td>
      <td>
      <ul>
      <li>地址：{$documentlist.address}</li>
      <li>区域：
      <if condition="$documentlist['area'] eq '1'">市区</if>
      <if condition="$documentlist['area'] eq '2'">江宁</if>
      <if condition="$documentlist['area'] eq '3'">江北</if>
      <li>面积：{$extendlist.house_area}平方米</li>
      <li>建筑年代：{$extendlist.house_age}年</li>
      <li>房屋总价：{$extendlist.house_total}万元</li>
      </ul>
      </td>
    </tr>
    <tr>
      <td>中介公司</td>
      <td>
      <ul>
      <li>公司名称：{$documentlist.agent_id}</li>
      <li>门店：{$extendlist.agent_address}</li>
      <li>中介经办人：{$extendlist.agent_name}</li>
      <li>联系电话：{$extendlist.agent_tel}</li>
      </ul>
      </td>
    </tr>
    <tr>
      <td>营销人员</td>
      <td>
      <ul>
      <li>营销人：{$marketname.user_name}</li>
      <li>签单人：{$signname.user_name}</li>
      </ul>
      </td>
    </tr>

  <!--银行审核-->
  <tr>
    <td width="120">银行审核</td>
    <td>
    <ul>
      <li>贷款银行（支行）
        <select name="part_bank_id" class="select2 kk bank-zhi" style=" width:150px">
          <option value="">请选择</option>
          <volist name="bankslist" id="bankslist" >
          <option <if condition="$auditlist['bank_id'] eq $bankslist['bank_id']">selected="selected"</if> value="{$bankslist.bank_id}">{$bankslist.bank_name}</option>
          </volist>
        </select>
      </li>
      <li>信贷员
        <input type="text" name="loan" id="loan"  value="{$documentlist.loan}" class="input-text kk" style=" width:120px">
      </li>
      <li>银行送审日期
        <input class="input-text kk" onClick="laydate()" name="audit_time" value="<if condition="$documentlist.audit_time neq ''">{$documentlist.audit_time|date="Y-m-d",###}</if>" style=" width:100px">
      </li>
      <li>预计银行审批完成日期
        <input class="input-text kk" name="plan_time"  value="<if condition="$auditlist.plan_time neq ''">{$auditlist.plan_time|date="Y-m-d",###}</if>" onClick="laydate()" style=" width:100px">
      </li>
    </ul>
    <ul class="clear">
    <volist name="reason" id="vo" >
    <li><if condition="$vo.creat_time neq ''">{$vo.creat_time|date="Y-m-d",###}</if> {$vo.bank_id|getBankname}&nbsp;&nbsp;未通过原因:  {$vo.content}</li>
    </volist>

    </ul>
    <ul>
    <li>银行实际审核完成日期：<if condition="$documentlist.audit_finish neq ''">{$documentlist.audit_finish|date="Y-m-d",###}</if></li>
    </ul>
    </td>
    </tr>


    <if condition="$documentlist['supervise'] eq 3">
    <tr>
    <td width="120">南房</td>
    <td>
      <ul>
        <li>传前场日期：<if condition="$extendlist.transfer_time neq ''">{$extendlist.transfer_time|date="Y-m-d",###}</if></li>
        <li>实际过户时间：<if condition="$extendlist.transfer_real_time neq ''">{$extendlist.transfer_real_time|date="Y-m-d",###}</if></li>
        <li>出件日期：<if condition="$extendlist.certificate_time neq ''">{$extendlist.certificate_time|date="Y-m-d",###}</if></li>
      </ul>
    </td>
    </tr>
  </if>



    <tr>
    <td width="120">不动产证</td>
    <td>
    <ul>
    <li>不动产证出件日期：<if condition="$extendlist.estate_time neq ''">{$extendlist.estate_time|date="Y-m-d",###}</if></li>
    <li>银行代办：<if condition="$extendlist['commission'] eq 1">是</if><if condition="$extendlist['commission'] eq 2">否</if></li>
    <li>备注：{$extendlist.estate_remark}</li>
    </ul>
    </td>
    </tr>


  <tr>
    <td width="120">公积金</td>
    <td>
      <ul>
        <li>公积金送审日期：<if condition="$accountlist.audit_time neq ''">{$accountlist.audit_time|date="Y-m-d",###}</if></li>
        <li>预计完成日期：<if condition="$accountlist.plan_time neq ''">{$accountlist.plan_time|date="Y-m-d",###}</if></li>
      </ul>
      <ul class="clear">
        <volist name="reasonlist" id="vo" >
        <li><if condition="$vo.creat_time neq ''">{$vo.creat_time|date="Y-m-d",###}</if> 未通过原因  {$vo.content}</li>
        </volist>
        <li>{$accountlist.reason}</li>
      </ul>
      <ul>
        <li>实际完成日期：<if condition="$accountlist.real_time neq ''">{$accountlist.real_time|date="Y-m-d",###}</if></li>
      </ul>
    </td>
  </tr>


<if condition="$documentlist['supervise'] neq 3">
  <tr>
  <td width="120">抵押</td>
  <td>
  <ul>
  <li>后场送前场时间：<if condition="$mortgagelist.transfer_time neq ''">{$mortgagelist.transfer_time|date="Y-m-d",###}</if></li>
  <li>收件时间：<if condition="$mortgagelist.get_time neq ''">{$mortgagelist.get_time|date="Y-m-d",###}</if></li>
  <li>未抵押原因：{$mortgagelist.reason}</li>
  <li>预计送抵押日期：<if condition="$mortgagelist.plan_time neq ''">{$mortgagelist.plan_time|date="Y-m-d",###}</if></li>
  <li>实际抵押日期：<if condition="$mortgagelist.real_time neq ''">{$mortgagelist.real_time|date="Y-m-d",###}</if></li>
  </ul>
  </td>
  </tr>



  <tr>
  <td width="120">他证</td>
  <td>
  <ul>
    <li>出他证日期：<if condition="$extendlist.else_time neq ''">{$extendlist.else_time|date="Y-m-d",###}</if></li>
    <li>预计出他证日期：<if condition="$extendlist.else_plan_time neq ''">{$extendlist.else_plan_time|date="Y-m-d",###}</if></li>
  </ul>
  </td>
  </tr>
</if>

  <tr>
  <td width="120">放款</td>
  <td>
  <ul>
    <li>送放款时间：<if condition="$extendlist.credit_time neq ''">{$extendlist.credit_time|date="Y-m-d",###}</if></li>
    <li>实际放款时间：<if condition="$documentlist.credit_real_time neq ''">{$documentlist.credit_real_time|date="Y-m-d",###}</if></li>
    <li>实际放款金额：{$extendlist.credit_real_money}万元</li>
    <li>放款备注：{$extendlist.credit_remark}</li>
  </ul>
  </td>
  </tr>

  <!--收费-->
  <tr>
  <td width="120">收费</td>
  <td>
  <ul><li>收费信息：{$chargelist.charge_time}</li></ul>
  </td>
  </tr>

  <!--发证-->
  <tr><td width="120">发证</td>
  <td>
  <ul>
    <li>发证日期：<if condition="$chargelist.certificate_time neq ''">{$chargelist.certificate_time|date="Y-m-d",###}</if></li>
    <li>潜在客户：<if condition="$documentlist['latent'] eq 1">是</if><if condition="$documentlist['latent'] eq 2">否</if></li>
  </ul>
  </td>
  </tr>

  <tr>
  <td colspan="2" style="text-align:center"><input type="submit" value="保存"  class="btn btn-danger radius"></td>
  </tr>

 </table>
</form>




<include file="Public/_footer" />

<script type="text/javascript">
$('.bank-zong').change(function(){
    var id = $('select[name="bank_id"]').val();
    $.ajax({
        type:'post',
        url:"{:U('Index/zhi')}",
        data:{id:id},
        dataType:'json',
        success:function(json){
            console.log(json);
            $('.bank-zhi').empty();
            $('.bank-zhi').append('<option value="">请选择支行</option>')
            var len=json.length;
            for(i = 0;i <= len;i++){
                $('.bank-zhi').append('<option value='+json[i]['bank_id']+'>'+json[i]['bank_name']+'</option>')
            }
        }
    })
})
$(".bank-zhi").change(function(){
  $("input[name='loan']").val("");
  $("input[name='audit_time']").val("");
  $("input[name='plan_time']").val("");
})

var index = parent.layer.getFrameIndex(window.name)
$("#form-mortgage-alert").submit(function(){
  $(".radius").attr('type','button');
        $.ajax({
          url:"{:U('Index/unlockCheck')}",
          type:'post',
          data:$('#form-mortgage-alert').serialize(),
          dataType:'json',
          success:function(data){
            if(data.ResultCode == '200'){
              layer.msg(data.ResultMessage,{time:1000},function(){
                  parent.window.location.reload()
                  parent.layer.close(index);
              });
            }
            else if(data.ResultCode == '500'){
                layer.msg(data.ResultMessage,{time:1000},function(){

                })
            }
          }
        })
        return false;
	});
  $('.one').blur(function(){
        if($(this).val()){
            if($('.two').val()){
                $('.three').val(parseFloat($(this).val()) + parseFloat($('.two').val()));
            }else{
                $('.three').val(parseFloat($(this).val()));
            }
        }else{
           $('.three').val(parseFloat($('.two').val()));
        }
    })
    $('.two').blur(function(){
        if($(this).val()){
            if($('.one').val()){
                $('.three').val(parseFloat($(this).val()) + parseFloat($('.one').val()));
            }else{
                $('.three').val(parseFloat($(this).val()));
            }
        }else{
           $('.three').val(parseFloat($('.one').val()));
        }
    })
</script>
</body>
</html>
